
package com.alibaba.dubbo.demo.provider;
 
import java.util.concurrent.TimeUnit;

import com.alibaba.dubbo.demo.DemoService;
 
public class DemoServiceImpl implements DemoService {
	int i = 0;
	
	@Override
    public String sayHello(String name) {
    	try {
    		//模拟超时异常
			TimeUnit.SECONDS.sleep(30);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
        return "Hello " + name + ++i;
    }
    
	@Override
    public String sayBye(String name){
    	System.err.println("bye: ---------------------------------------------" + name);
    	throw new RuntimeException("发生异常...");
    }
 
}